const CompressionPlugin = require('compression-webpack-plugin');
const path = require('path')
function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    publicPath: process.env.NODE_ENV === "development" ? "/" : "/",
    lintOnSave: false,
    productionSourceMap: false,
    // publicPath: './',
    outputDir: 'dist',
    assetsDir: 'assets',
    configureWebpack: {
        name:'yzl',
        resolve: {
            alias: {
                '@': resolve('src')
            }
        },
        devtool: "eval-cheap-source-map"
    },
    devServer: {
        port: 8888,
        https: false,
        open: true,
        proxy: {
            '/api': {
                target: `http://backend-api-02.newbee.ltd/manage-api/v1`,
                changeOrigin: true,
                secure: false,
                pathRewrite: {
                    '^/api': '',
                    // 请求数据路径别名,这里是注意将static/mock放入public文件夹
                }
            }
        },
        client: {
            overlay: false,
        },
    },

};